package com.acme;

import org.phnq.babel.*;

public class AcmeObjectFactory
{
	public JSValue createObject(JSArray args)
	{
		String section = args.get(1).toString();
		if(section.equals("menu"))
		{
			JSArray menuItems = new JSArray();
			
			{
				JSObject menuItem = new JSObject();
				menuItem.put("title", new JSString("News"));
				menuItem.put("phnqlet", new JSString("com.acme.News"));
				menuItems.add(menuItem);
			}

			{
				JSObject menuItem = new JSObject();
				menuItem.put("title", new JSString("Artists"));
				menuItem.put("phnqlet", new JSString("com.acme.Artists"));
				menuItems.add(menuItem);
			}
			
			{
				JSObject menuItem = new JSObject();
				menuItem.put("title", new JSString("Releases"));
				menuItem.put("phnqlet", new JSString("com.acme.Releases"));
				menuItems.add(menuItem);
			}

			{
				JSObject menuItem = new JSObject();
				menuItem.put("title", new JSString("About"));
				menuItem.put("phnqlet", new JSString("com.acme.About"));
				menuItems.add(menuItem);
			}
			
			return menuItems;
		}
		else
		{
			return new JSObject();
		}
	}
}
